package com.jkc.xh.fragments;


import android.view.View;
import android.widget.TextView;

import com.jkc.xh.R;
import com.jkc.xh.fragments.core.BaseFragment;
import com.jkc.xh.models.BalModel;
import com.jkc.xh.utils.Tool;
import com.jkc.xh.views.widget.NavBar;

import org.androidannotations.annotations.AfterViews;
import org.androidannotations.annotations.EFragment;
import org.androidannotations.annotations.FragmentArg;
import org.androidannotations.annotations.ViewById;

/**
 * 平仓结算
 */
@EFragment(R.layout.fragment_pingcang_detail)
public class BalDetailFragment extends BaseFragment {

    @ViewById(R.id.nav_bar)
    NavBar nav_bar;
    @FragmentArg("modelExtra")
    BalModel modelExtra;

    @ViewById
    TextView buss_time;
    @ViewById
    TextView close_time;
    @ViewById
    TextView stock_code;
    @ViewById
    TextView stock_name;
    @ViewById
    TextView sum_buy_amount;
    @ViewById
    TextView avg_buy_price;
    @ViewById
    TextView buy_value;
    @ViewById
    TextView fee;
    @ViewById
    TextView bean;
    @ViewById
    TextView deposit;
    @ViewById
    TextView sell_amount;
    @ViewById
    TextView sell_price;
    @ViewById
    TextView sell_value;
    @ViewById
    TextView all_income;
    @ViewById
    TextView all_realin;

    @AfterViews
    void initData() {
        nav_bar.setOnMenuClickListener(new NavBar.OnMenuClickListener() {
            @Override
            public void onLeftMenuClick(View view) {
                finishFragment();
            }

        });
        nav_bar.setTitle(modelExtra.stock_name);
        buss_time.setText(Tool.formatSecondSimpleFullDate(modelExtra.buss_time));
        close_time.setText(Tool.formatSecondSimpleFullDate(modelExtra.close_time));
        stock_code.setText(modelExtra.stock_code);
        stock_name.setText(modelExtra.stock_name);
        sum_buy_amount.setText(modelExtra.sum_buy_amount);
        avg_buy_price.setText(modelExtra.avg_buy_price);
        buy_value.setText(modelExtra.buy_value);
        fee.setText(modelExtra.fee);
        bean.setText(modelExtra.bean);
        deposit.setText(modelExtra.deposit);
        sell_amount.setText(modelExtra.sell_amount);
        sell_price.setText(modelExtra.sell_price);
        sell_value.setText(modelExtra.sell_value);
        all_income.setText(modelExtra.all_income);
        all_realin.setText(modelExtra.all_realin);
    }


}
